package light.head.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import light.head.constant.Sys;

import org.hibernate.annotations.Formula;


/**
 * 请假记录表
 */
@Entity
@Table
public class LeaveManage implements Serializable{

	private static final long serialVersionUID = -2582607393136372318L;
	
	private Integer code;
	private Date st;					//请假开始日期
	private Date et;					//请假结束日期
	private Integer day;				//天数
	private String reason;				//原因
	private Integer cu;					//创建人
	private Date ct;					//创建时间
	private Boolean deleted;			//是否删除
	private Integer oc;					//机构编号
	private Boolean head = false;		// 是否是负责人
	private Byte pass = Sys.B_ONE;		//状态（1.未审核2.不通过3.通过4.审核中）
	
	//@Formula
	private String cuname;				//创建者姓名
	private String on;
	private List<AuditStatus> auditStatusList;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public Date getSt() {
		return st;
	}
	@Column
	public Date getEt() {
		return et;
	}
	@Column
	public String getReason() {
		return reason;
	}
	@Column
	public Integer getCu() {
		return cu;
	}
	@Column
	public Date getCt() {
		return ct;
	}
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	@Column
	public Integer getOc() {
		return oc;
	}
	@Column
	public Byte getPass() {
		return pass;
	}
	@Column
	public Boolean getHead() {
		return head;
	}
	@Column
	public Integer getDay() {
		return day;
	}
	@Formula("(SELECT u.realName FROM UserInfo u WHERE u.code = cu)")
	public String getCuname() {
		return cuname;
	}
	@Formula("(SELECT o.name FROM Organ o WHERE o.code = oc)")
	public String getOn() {
		return on;
	}
	@Transient
	public List<AuditStatus> getAuditStatusList() {
		return auditStatusList;
	}
	
	
	
	
	
	
	
	
	
	public void setDay(Integer day) {
		this.day = day;
	}
	public void setHead(Boolean head) {
		this.head = head;
	}
	public void setPass(Byte pass) {
		this.pass = pass;
	}
	public void setAuditStatusList(List<AuditStatus> auditStatusList) {
		this.auditStatusList = auditStatusList;
	}
	public void setOn(String on) {
		this.on = on;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setCuname(String cuname) {
		this.cuname = cuname;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public void setSt(Date st) {
		this.st = st;
	}

	public void setEt(Date et) {
		this.et = et;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public void setCu(Integer cu) {
		this.cu = cu;
	}

	public void setCt(Date ct) {
		this.ct = ct;
	}


	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	

}
